<h4 class="header"><%=_("Task Status")%></h4>
<table class="<%= table_css_classes('table-condensed') %>">
  <tr>
    <th><%= _("State") %></th>
    <th><%= _("Result") %></th>
    <th><%= _("No. of Tasks") %></th>
    <th><%= _("Last start time") %></th>
  </tr>
  <% ForemanTasks::Task::Summarizer.new.summarize_by_status.each do |result| %>
    <tr class="<%= ForemanTasks::Task::StatusExplicator.new.is_erroneous(result) ? 'text-danger' : '' %>">
      <td><%= result.state %></td>
      <td><%= result.result %></td>
      <td><%= link_to result.count, main_app.foreman_tasks_tasks_path(:search => "state=#{result.state}&result=#{result.result}") %></td>
      <td><%= result.started_at ? date_time_relative(result.started_at) : _('N/A') %></td>
    </tr>
  <% end %>
</table>
